from dataclasses import dataclass


# 禁止生产 __init__ 构造函数
# @dataclass(init=False)
# 禁止生产 repr
# @dataclass(init=False, repr=False)
@dataclass
class Student:
    name: str
    age: int
    school_name: str

    # def __init__(self, name, age, school_name):
    #     self.name = name
    #     self.age = age
    #     self.school_name = school_name

    def test(self):
        print(self.name)


s1 = Student('jack', 18, 'Tinghua')
s1.test()
print(s1.__repr__())
